#include "SpriteObstacle.h"
using namespace cocos2d;
#include "CGlobal.h"
SpriteObstacle::SpriteObstacle(void)
{
}

SpriteObstacle::~SpriteObstacle(void)
{
}

SpriteObstacle * SpriteObstacle::node(const char *szName)
{
	SpriteObstacle *pObstacle=new SpriteObstacle;
	if (pObstacle)
	{
		pObstacle->autorelease();
		if (pObstacle->init(szName))
		{
			return pObstacle;
		}
	}
	return NULL;
}

bool SpriteObstacle::init(const char *szName)
{
	if(!CCSprite::init())
	{
		return false;
	}
	CCTexture2D *pTexture=CGlobal::TextureWithFile(szName);
	if (!pTexture||!this->initWithTexture(pTexture))
	{
		return false;
	}
	return true;
}